﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ue.Infrastructure.DomainBase;
using Ue.Infrastructure.RepositoryFramework;

namespace Ue.Qcdz.Domain.FriendLink
{
    public class FriendLinksService
    {
        private static IFriendLinksRepository _repository;
        static FriendLinksService()
        {
            FriendLinksService._repository = RepositoryFactory.GetRepository<IFriendLinksRepository, FriendLinks>();
        }
        public static FriendLinks GetFriendLinks(object resourceKey)
        {
            return FriendLinksService._repository.FindBy(resourceKey);
        }
        public static IList<FriendLinks> GetFriendLinks()
        {
            return FriendLinksService._repository.FindAll();
        }
        public static IDataResult<FriendLinks> GetFriendLinks(IDataQuery dataQuery)
        {
            return FriendLinksService._repository.FindBy(dataQuery);
        }
        public static void AddFriendLinks(FriendLinks friendLinks)
        {
            FriendLinksService._repository.Add(friendLinks);
        }
        public static void DeleFriendLinks(FriendLinks friendLinks)
        {
            FriendLinksService._repository.Remove(friendLinks);
        }

        public static void UpdatePermission(FriendLinks friendLinks)
        {
            FriendLinksService._repository[friendLinks.Key] = friendLinks;
        }
    }
}
